package com.dragonboat.repository;

import com.dragonboat.entity.Registration;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Optional;

@Repository
public interface RegistrationRepository extends JpaRepository<Registration, Integer> {
    List<Registration> findByEventEventId(Integer eventId);
    List<Registration> findByTeamTeamId(Integer teamId);
    Optional<Registration> findByEventEventIdAndTeamTeamId(Integer eventId, Integer teamId);
    List<Registration> findByEventOrganizerOrganizerId(Integer organizerId);
    boolean existsByEventEventIdAndTeamTeamId(Integer eventId, Integer teamId);
}